package com.zgscwjm.taobaphelper;

import android.content.Intent;
import android.util.Log;
import android.view.View;

import com.zgscwjm.taobaphelper.exutils.StringUtils;
import com.zgscwjm.taobaphelper.xp.FileManager;

import static com.zgscwjm.taobaphelper.BaseConfig.b;

/**
 * Created by zgscwjm on 17-3-1.
 * 对应原来bh
 */
public class click_exit implements View.OnClickListener {

    final MainActivity mainActivity;

    public click_exit(MainActivity mainActivity) {
        this.mainActivity = mainActivity;
    }

    @Override
    public void onClick(View v) {
        //fixme 这里定位的是auto.DecodeHex
        b.b = null;
        FileManager.deleteDBInfo(this.mainActivity,FileManager.CookiesLoginParam);
        FileManager.writeContent(FileManager.accParamPath, StringUtils.EMPTY);
        FileManager.writeContent(FileManager.userIdPath,StringUtils.EMPTY);
        Log.i("UserOperation", "logout success !! ");
        this.mainActivity.stopService(new Intent(this.mainActivity,NetflowMissionService.class));
        this.mainActivity.finish();
    }
}
